#ifndef _PROXY_H_
#define _PROXY_H_

#include <iostream>

using namespace std;

class ISubject
{
public:
	virtual void Request() = 0;
};


class RealSubject : public ISubject
{
public:
	virtual void Request();
};

class Proxy: public ISubject
{
public:
	Proxy(ISubject *subject = NULL)
		:_real_subject(subject)
		{}
	~Proxy()
	{
		if(_real_subject)
			delete _real_subject;
	}
	
	virtual void Request();
private:
	ISubject *_real_subject;
};


#endif
